package cn.com.forever.offer;

//青蛙每次可以跳1阶，2阶。。。。。n阶
public class JumpFloorII {
    public static void main(String[] args) {
        System.out.println(jumpfloor(6));
    }

    public static int jumpfloor(int target){
        if(target == 1){
            return 1;
        }
        int sum = 1; //一次性跳n阶
        for (int i = 1; i < target; i++) {
            sum += jumpfloor(target - i);  //一次性跳1阶 到  n-1阶的总和
        }
        return sum;
    }
}
